	IDENTIFICATION DIVISION.
	   PROGRAM-ID PRIMENUMBER.
	ENVIRONMENT DIVISION.
	   CONFIGURATION SECTION.
	   SOURCE-COMPUTER.
	   OBJECT-COMPUTER.
	   INPUT-OUTPUT SECTION.
	DATA DIVISION.
	WORKING-STORAGE SECTION.
	01 DUMMY.
	  02 A    PIC 999 OCCURS 20 TIMES.
	77 I      PIC 99 VALUE IS 0.
	77 J      PIC 999 VALUE IS 0.
	77 REMAIN PIC 999.
	77 TEMP   PIC 999.
	77 N      PIC 99.
	77 PRIME  PIC 9.
	77 PROXY  PIC ZZZ.
	77 C      PIC X.

	PROCEDURE DIVISION.
	SPARA.
	   DISPLAY "=== PROGRAM TO FIND PRIME NUMBERS ===".
	   DISPLAY " ".
	   DISPLAY (LIN, COL) "HOW MANY NUMBERS? ".
	   ACCEPT N.
	   PERFORM RPARA N TIMES.
	   DISPLAY " ".
	   MOVE 0 TO I.
	   DISPLAY "PRIME NUMBERS".
	   PERFORM PRIMECHECK N TIMES.
	   ACCEPT C.
	PPARA.
	   DISPLAY " ".
	   STOP RUN.
	
	RPARA. 
	   DISPLAY (LIN, COL) "NUMBER:".
	   ADD 1 TO I.
	   ACCEPT A(I).

	PRIMECHECK.
	   MOVE 0 TO PRIME, ADD 1 TO I, MOVE 1 TO J. 
	   IF A(I) > 0 MOVE 1 TO PRIME.
	   IF A(I) > 2 PERFORM CPARA.
	   IF PRIME = 1 MOVE A(I) TO PROXY DISPLAY PROXY.

	CPARA.
	   ADD 1 TO J.
	   DIVIDE A(I) BY J GIVING TEMP REMAINDER REMAIN.
	   IF REMAIN = 0 MOVE 0 TO PRIME.
	   IF J < A(I) / 2 AND NOT REMAIN = 0 GO TO CPARA.


	   
